-
Couldn't load subscription status.
- Fork 8k
Fix GH-17658: COMPersistHelper::LoadFromStream() can segfault #17659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The actual fix is trivial, but to be able to test the behavior we have to introduce an own COM object, since existing persistable objects likely implement `IPersistInit`, not only `IPersist`. We also want to avoid further test dependencies on possibly unavailable objects, such as `Word.Application`. To this purposes, we add a small COM in-process server, which may be extended for other testing purposes. We keep it simple by implementing it in C++, but without using any more sophisticated frameworks like ATL. This component needs to be built explicitly (`nmake comtest.dll`), and also needs to be explicitly registered (`nmake register_comtest`). When no longer needed, it is possible to unregister the component (`nmake unregister_comtest`).
`$(LINK)` may contain spaces, clang-cl does not recognize `/Fo:`, and the output folder may already exist.
This can be useful for debugging.
|
Noticed that we may swallow a helpful php-src/ext/com_dotnet/com_com.c Line 145 in 0d8aebf
Will have a look into that in a different PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSTM
The actual fix is trivial, but to be able to test the behavior we have to introduce an own COM object, since existing persistable objects likely implement
IPersistInit, not onlyIPersist. We also want to avoid further test dependencies on possibly unavailable objects, such asWord.Application.To this purposes, we add a small COM in-process server, which may be extended for other testing purposes. We keep it simple by implementing it in C++, but without using any more sophisticated frameworks like ATL.
This component needs to be built explicitly (
nmake comtest.dll), and also needs to be explicitly registered (nmake register_comtest). When no longer needed, it is possible to unregister the component (nmake unregister_comtest).TODO
COMPersistHelper::InitNew()in the test case to ensure thatIPersistInitis not implemented (might later happen by accident, rendering the regression test useless)